<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title></title>
        <script src="./lib/vue.js" type="text/javascript" charset="utf-8"></script>
        <style type="text/css">
            .active {
                color: red;
            }
        </style>
    </head>
    <body>
        <div id="myApp">
            <div v-bind:class="{active:isActive}">红色文本1</div>
            <div :class="{active:isActive}">红色文本2</div>
            <button @click="btnClick">改变class吧</button>
        </div>
    </body>

    <script type="text/javascript">
        var myApp = new Vue({
            el: '#myApp',
            data: {
                isActive: true
            },
            methods: {
                btnClick: function() {
                    this.isActive = !this.isActive;
                }
            }
        });
    </script>
</html>
